package hero.main;

import android.app.Activity;
import android.content.Intent;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;

public class HeroesOfNewerthImageActivity extends Activity {
	/**
	 * Class members
	 */
	MediaPlayer player;
	private ImageButton heroButton;
	/**
	 * Class members
	 */

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.imagemain);
		
		 this.heroButton = (ImageButton)this.findViewById(R.id.buttonHero);		
		 this.heroButton.setSoundEffectsEnabled(false);
		 player  = MediaPlayer.create(HeroesOfNewerthImageActivity.this,R.raw.slide_in);
		 player.start();
		  
		
	    this.heroButton.setOnClickListener(new OnClickListener() {
	          public void onClick(View v) {
	        	  player  = MediaPlayer.create(HeroesOfNewerthImageActivity.this,R.raw.button_click_03);
	        	  player.start();
	        	  player.setOnCompletionListener(new OnCompletionListener() {

                    
                      public void onCompletion(MediaPlayer mp) {
                          mp.release();
                      }

                  });
	        	  
	        	  Intent i = new Intent(HeroesOfNewerthImageActivity.this,HeroList.class);
	        	  startActivity(i);
	        	  

	          }
	        });
		
		
		
		
		
		
		player  = MediaPlayer.create(this,R.raw.button_click_03);
		
		

	}
}